﻿using MediatR;
using S.Eartag.Domain.Model;
using S.Eartag.Infrastructure.Interface;
using S.Eartag.Read.API.Application.Command.SheepFileConditionCommand;

namespace S.Eartag.Read.API.Application.CommandHandlers.SheepFileConditionCommandHandler
{
    public class SheepFileConditionFindCommandHandler : IRequestHandler<SheepFileConditionFindCommand, SheepFile>
    {
        private readonly ISheepFileRepository sheepFileRepository;

        public SheepFileConditionFindCommandHandler(ISheepFileRepository sheepFileRepository)
        {
            this.sheepFileRepository = sheepFileRepository;
        }

        public async Task<SheepFile> Handle(SheepFileConditionFindCommand request, CancellationToken cancellationToken)
        {
            return await sheepFileRepository.Get(request.id);
        }
    }
}
